package com.dimanche.module_course.data;

import com.dimanche.library_db.repository.DirRepository;
import com.dimanche.module_course.data.source.Course100Source;

import me.goldze.mvvmhabit.base.BaseModel;

/**
 * author : Dimanche
 * date   : 2021/3/26 17:50
 * desc   :
 * version: 1.0
 */
public class CourseRepository extends BaseModel {

    private volatile static CourseRepository INSTANCE = null;
    private final Course100Source mCourse100Source;
    private final DirRepository mDirRepository;

    private CourseRepository(Course100Source mCourse100Source, DirRepository mDirRepository) {
        this.mCourse100Source = mCourse100Source;
        this.mDirRepository = mDirRepository;
    }

    public static CourseRepository getInstance(Course100Source mCourse100Source, DirRepository mDirRepository) {
        if (INSTANCE == null) {
            synchronized (CourseRepository.class) {
                if (INSTANCE == null) {
                    INSTANCE = new CourseRepository(mCourse100Source, mDirRepository);
                }
            }
        }
        return INSTANCE;
    }

    /**
     * 获取课程
     *
     * @return
     */
    public Course100Source getCourse100Source() {
        return mCourse100Source;
    }

    /**
     * 获取字典实例
     *
     * @return
     */
    public DirRepository getDirRepository() {
        return mDirRepository;
    }


}
